using RobotSimulator.Basic;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;

public class ForceActuator : BasicActuator { }
public class CmdAddForce : Command
{
    protected Vector3 pos;
    protected Vector3 force;
    public virtual string  AddForce(IEU ieu)
    {
        //if (ieu is not ForceActuator)
        //{
        //    return Command.ErrorText;
        //}
        ForceActuator basicActuator = (ForceActuator)ieu;
        basicActuator.rb.AddForceAtPosition(force, pos);
        return "ok";
    }

    public CmdAddForce(Vector3 pos, Vector3 force)
    {
        this.pos = pos;
        this.force = force;
        this.execute = AddForce;
    }
    public CmdAddForce()
    {
        pos = Vector3.zero;
        force = Vector3.zero;
        execute = AddForce;
    }
}

